import App from "@/App";
import Home from '@/pages/index/Index'
import Mine from '@/pages/mine/Index'
import { BrowserRouter, Route, Routes, Navigate } from "react-router-dom";

// 两种路由方式 BrowserRouter， HashRouter

// const baseRoute = () => {
//   return ()
// }

// 使用简写， 不是大括号，return
const baseRoute = () => (
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<App />}>
        {/**配置重定向路径 */}
        <Route path="/" element= {<Navigate to='/home'/>}></Route> 
        <Route path="/home" element={<Home />}></Route>
        <Route path="/mine" element={<Mine />}></Route>
      </Route>
    </Routes>
  </BrowserRouter>
)

export default baseRoute